package com.fucking.great.context.plun.http;

import com.fucking.great.context.common.http.HttpRequestCommon;
import com.fucking.great.context.plun.BasePlug;

import java.util.Map;

/**
 * 先不考虑多源的情况。
 * db组件。
 */
public class HttpPlug extends BasePlug {
    public static final String PLUN_NAME = "http";

    public HttpPlug( Map<String, String> config) {
        super( config,new String[]{
                HttpRequestCommon.class.getName(),
                Map.class.getName()
        });
    }

    @Override
    protected void initUserPlunMap(Map<String, Object> userPlun) {
        HttpRequestCommon httpRequestCommon = new HttpRequestCommon();
        userPlun.put(PLUN_NAME,httpRequestCommon);
    }


    @Override
    public void commit() {
        HttpRequestCommon session = this.getUserPlun(PLUN_NAME);;
        session.realExecute();
    }

}
